#ifndef FIND_REPLACE_DIALOG_H
#define FIND_REPLACE_DIALOG_H

#include <QDialog>

class QPlainTextEdit;
class QCheckBox;
class QLineEdit;
class QPushButton;

class FindReplaceDialog : public QDialog {
    Q_OBJECT
    
public:
    explicit FindReplaceDialog(QPlainTextEdit *editor, QWidget *parent = nullptr);
    
signals:
    void findNext(const QString &text, bool caseSensitive, bool wholeWord);
    void replace(const QString &find, const QString &replace, 
                bool caseSensitive, bool wholeWord);
    void replaceAll(const QString &find, const QString &replace, 
                   bool caseSensitive, bool wholeWord);
    
private slots:
    void findNextClicked();
    void replaceClicked();
    void replaceAllClicked();
    
private:
    QPlainTextEdit *editor;
    QLineEdit *findEdit;
    QLineEdit *replaceEdit;
    QCheckBox *caseCheckBox;
    QCheckBox *wholeWordCheckBox;
    QPushButton *findNextButton;
    QPushButton *replaceButton;
    QPushButton *replaceAllButton;
};

#endif // FIND_REPLACE_DIALOG_H